package com.mifengkong.cygtools.jjcard;

import android.os.Build;

import com.mifengkong.cygtools.R;
import com.mifengkong.cygtools.model.BaseJJCardModel;
import com.mifengkong.frtools.app.FRApplication;
import com.mifengkong.frtools.util.FRDeviceUtil;
import com.mifengkong.frtools.util.NetWorkUtil;

import io.reactivex.Observable;
import io.reactivex.Observer;

/**
 * Created by jack on 17/5/5
 */

public class PhoneLoginModel extends BaseJJCardModel {


    public static PhoneLoginModel getInstance() {
        return getPresent(PhoneLoginModel.class);
    }

//    http://demo.exezcc.mifengkong.cn/user/phoneLogin?dev_no=EML-AL00&code=0000&net_info=wifi&app_union_name=jjcard&plat_type=1&plat_version=1.2.6&uuid=3e4a5284ca29ff29840039a348c5d44d&client_id=ab0d6d18920d6937241ad5c08fb24c4b&token=75fc15d5ae90e4adbde063986fe8774d&app_name=懒人信用卡&phone=18270822045&user_id=&dev_sys=27&package_name=cn.fengrong.cardmanager&source_id=channelid
    public void execute(Observer<UserInfo> observer) {
        addParamStrings("dev_sys", String.valueOf(Build.VERSION.SDK_INT));
        addParamStrings("package_name","cn.fengrong.cardmanager");
        addParamStrings("source_id","channelid");
        addParamStrings("app_name", FRApplication.getInstance().getResources().getString(R.string.app_name));
        addParamStrings("net_info", NetWorkUtil.getCurrentNetworkType());
        addParamStrings("dev_no", FRDeviceUtil.getPhoneModels());
        addParamStrings("uuid", "");
        addParamStrings("phone", "18270822045");
        addParamStrings("code", "0000");
        addParamStrings("client_id", "sdfsdfsdfsdf");
        addParamStrings("uuid", "3e4a5284ca29ff29840039a348c5d44d");
        Observable observable = mServletApi.getLoginInfo(mParams).map(new HttpFunctionForCard());
        toSubscribe(observable, observer);
    }
}